import request from '../../utils/request'

export function getList(carpark){
    return request({
      url:'/carparkinfo',
      method:'get',
      params: carpark
    })
}

export function addCarpark(carparkForm){
  return request({
    url:'/carparkinfo',
    method:'post',
    data: carparkForm,
  })
}

export function updateCarpark(carparkForm){
  return request({
    url:'/carparkinfo',
    method:'put',
    data: carparkForm,
  })
}



export function getCarparkInfoById(id){
  return request({
    url:`/carparkinfo/${id}`,
    method:'get'
  })
}

export function deleteCarpark(id){
  return request({
    url:`/carparkinfo/${id}`,
    method:'delete'
  })
}

// 车位

export function getParkingSpaceList(parkingSpace){
  console.log("iiii",parkingSpace)
    return request({
      url:'/carparkinfo/parkingSpace',
      method:'get',
      params: parkingSpace
    })
}

export function addParkingSpace(parkingSpaceForm){
  console.log("tianjiaaaaaaaaaaaaaaaaaa",parkingSpaceForm)
  return request({
    url:'/carparkinfo/parkingSpace',
    method:'post',
    data: parkingSpaceForm,
  })
}

export function updateParkingSpace(parkingSpaceForm){
  return request({
    url:'/carparkinfo/parkingSpace',
    method:'put',
    data: parkingSpaceForm,
  })
}

export function getParkingSpaceInfoById(id){
  return request({
    url:`/carparkinfo/parkingSpace/${id}`,
    method:'get'
  })
}

export function deleteParkingSpace(id){
  return request({
    url:`/carparkinfo/parkingSpace/${id}`,
    method:'delete'
  })
}

// export function getCarparkId(){
//   return request({
//     url:`/carparkinfo/${1}`,
//     method:'get'
//   })
// }



